import React, {useState} from "react";
import {Modal} from "antd";
import EnvForm from "./EnvForm";
import './envStyle.scss'

const EnvFormModel = ({envId,name}) => {
    const [visible, setVisible] = useState(false);
    const showModal = () => setVisible(true);
    const hideModal = () => setVisible(false);

    return(
        <>
            <span className={"link-text"} onClick={showModal}>{name}</span>
            <Modal
                title="环境设置"
                open={visible}
                onCancel={hideModal}
                width={760}
                centered
                okText={'提交'}
                cancelText={'取消'}
                footer={null}
            >
                <EnvForm envId={envId}/>
            </Modal>
        </>

    )
};

export default EnvFormModel;